package com.atguigu.gmall.order.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.order.client.impl.OrderDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-19 19:47
 */
@FeignClient(value = "service-order", fallbackFactory = OrderDegradeFeignClient.class)
public interface OrderFeignClient {

	@GetMapping("/api/order/auth/trade")
	public Result trade();

	@GetMapping("/api/order/inner/getOrderInfo/{orderId}")
	public OrderInfo getOrderInfo(@PathVariable("orderId") Long orderId);

	@PostMapping("/api/order/inner/seckill/submitOrder")
	public Long submitOrder(OrderInfo orderInfo);

}
